<template>
  <div class="login">
    <van-nav-bar
        title="登录"
        left-text="返回"
        left-arrow
        fixed
        @click-left="onClickLeft"
    />
    <div class="main">
      <div class="logo">
        <img src="https://themes.taohuren.com/m/static/css/bg/thr_logo.png" alt="">
      </div>
      <van-form @submit="onSubmit">
        <van-field
            v-model="form.account"
            name="用户名"
            label="用户名"
            placeholder="手机号/邮箱"
            :rules="[{ required: true, message: '请填写用户名' }]"
        />
        <van-field
            v-model="form.password"
            type="password"
            name="密码"
            label="密码"
            placeholder="请输入密码"
            :rules="[{ required: true, message: '请填写密码' }]"
        />
        <van-field
            v-model="form.password2"
            type="password"
            name="密码"
            label="确认密码"
            placeholder="再次输入密码"
            :rules="[{ required: true, message: '请再次填写密码' }]"
        />
        <div style="margin: 16px;">
          <van-button round block native-type="submit" style="background: #993F26; color: white">免费注册</van-button>
        </div>
      </van-form>
    </div>
  </div>
</template>

<script>
export default {
  name: "Register",
  data(){
    return{
      form:{
        account: '',
        password: '',
        password2: ''
      }
    }
  },
  methods:{
    onClickLeft(){
      this.$router.push({
        path: '/login',
      });
    },
    onSubmit(){
      this.$router.push('/login')
    }
  }
}
</script>

<style scoped lang="less">
.mint-header{
  background-color: #993F26;
}
.main{
  padding-top: 50px;
}
.logo{
  width: 50px;
  height: 50px;
  margin: 0 auto;
  padding: 30px 0;
  img{
    width: 100%;
  }
}

</style>
